package me.zhengjie.modules.easycode.rest;

import me.zhengjie.annotation.Log;
import me.zhengjie.modules.easycode.domain.Project;
import me.zhengjie.modules.easycode.service.ProjectService;
import me.zhengjie.modules.easycode.service.dto.ProjectDto;
import me.zhengjie.modules.easycode.service.dto.ProjectQueryParam;
import org.springframework.data.domain.Pageable;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.*;
import java.util.Set;

/**
* @author guoqing
* @date 2021-06-16
**/
@RestController
@RequiredArgsConstructor
@Api(tags = "项目管理")
@RequestMapping("/api/Project")
public class ProjectController {

    private final ProjectService ProjectService;


    @DeleteMapping
    @Log("删除项目")
    @ApiOperation("删除项目")
    @PreAuthorize("@el.check('Project:del')")
    public ResponseEntity delete(@RequestBody Set<Integer> ids) {
        ProjectService.removeByIds(ids);
        return new ResponseEntity<>(HttpStatus.OK);
    }
}
